package com.asf.sofom.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.asf.sofom.domain.OAuthorities;
import com.asf.sofom.domain.OUsers;
import com.asf.sofom.repository.AuthoritiesDao;
import com.asf.sofom.repository.UsersDao;

@Component
public class SimpleAltaWebManager implements AltaWebManager{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Autowired
	private UsersDao usersDao;
	@Autowired
	private AuthoritiesDao authoritiesDao;
	
	public void setUsersDao(UsersDao usersDao){
		this.usersDao = usersDao;
	}
	
	public void guardaAlta(OUsers user) {
		// TODO Auto-generated method stub
		usersDao.guardaUser(user);
	}

	public List<OUsers> getAltaList() {
		// TODO Auto-generated method stub
		return usersDao.getUsers();
	}

	public List<OUsers> buscaAltaList(OUsers user) {
		// TODO Auto-generated method stub
		return usersDao.buscaUser(user);
	}

	public void guardaAuthority(OAuthorities auth) {
		// TODO Auto-generated method stub
		authoritiesDao.setAuthorities(auth);
	}

}
